# -*- coding: utf-8 -*-
# This code written by ChanGOGOGO
"""
页面元素基类
"""
from playwright.sync_api import Page


class BasePage:
    def __init__(self, page: Page):
        self.page = page

    def button(self, button_name):
        """名称唯一的按钮（当两个按钮名称存在包含关系时，不能用本方法）"""
        element = self.page.locator(f'button:has-text("{button_name}")')
        return element
